﻿var sc_boxy_;
function sc_showWindow(id, title) {
	sc_boxy_ = new Boxy($('#window' + id), { modal: false, title: title, closeText: '[×]', draggable: true });
}
function sc_closeWindow() {
	try {
		sc_boxy_.hide();
	}
	catch (e) {
	}
	
}
function sc_calculateResult(id, callbackFunction,controlType) {
	var array = new Array();
	$("#window" + id + " input:" + controlType).each(
		function(index) {
			if (this.checked) {
				var item = new sc_SelectResult(this.getAttribute("text"), this.value);
				array[array.length] = item;
			}
		}
	);
	sc_closeWindow();
	if(callbackFunction)
		callbackFunction(array);
	//window.eval('closeWindow();try{ '+callbackFunction+'(array); }catch(e){}');
}

function sc_SelectResult(text, value) {
	this.Text = text;
	this.Value = value;
}